package com.headingsoft.jxc.domain;

import javax.persistence.ManyToOne;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import java.util.Date;
import java.util.List;

import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;

import org.springframework.format.annotation.DateTimeFormat;

@RooJavaBean
@RooToString
@RooEntity
public class PurchaseOrder {

    @ManyToOne
    private Partner customer;

    private String contactPerson;

    private String contactTel;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
    private Date orderDate;
    
    private float otherFee;
    
    private String orderAddress;
    
    @ManyToOne
    private Warehouse warehouse;
    
    @ManyToOne
    private Employee operator;
    
    @Size(max=512)
    private String remark;
    
    @OneToMany(mappedBy="purchaseOrder")
    private List<PurchaseOrderItem> items;
}
